@import "vendor.less";

@color-green: #74AD40;
@color-red: #DB5959;
@color-blue: #55ACCC;
@color-gray: #888888;

* {
    box-sizing: border-box;
}

body {
    font-family: @font-family-sans-serif;
    font-size: 14px;
    padding: 0 1rem;
    margin: 0;
    color: #555;
}

hr {
    border: 0;
    margin: 1rem 0px;
    border-bottom: 1px solid #ddd;
}

button, .xt-button {
    font-family: inherit;
    border: 0;
    display: inline-block;
    font-size: 14px;
    cursor: pointer;
    font-weight: bold;
}

.nav.editor-tabs > li > a {
    padding: 10px 10px;
}

#global-toolbar {
    background: #eee;
    border-bottom: 1px solid #ddd;
    padding: 0.5rem 1rem;
    margin-left: -1rem;
    margin-right: -1rem;
    margin-bottom: 1rem;
    .publish-btn {
        background: @color-green;
        color: #fff;
        padding: 6px 12px;
        float: right;
        border-radius: 4px;
        &:hover, &:focus {
            background: lighten(@color-green, 5%);
        }
    }
    .revert-btn {
        color: #999;
        padding: 6px 12px;
        background: transparent;
    }
}

#layout {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
    .layout-row {
        display: flex;
        margin-bottom: 1rem;
    }
    .layout-add-row-btn {
        padding: 5px 10px;
        color: #555;
        background: transparent;
        border-radius: 4px;
        border: 1px solid #ddd;
        font-size: 13px;
        &:hover, &:focus {
            background: #eee;
        }
    }
    .layout-add-cell-btn,
    .layout-del-row-btn,
    .layout-move-row-btn {
        background: transparent;
        padding: 0px 6px;
        border: 1px solid #ddd;
        border-radius: 2px;
        display: block;
        &:hover, &:focus {
            background: #eee;
        }
    }
    .layout-add-cell-btn {
        margin-right: 2px;
        color: @color-green;
        &[disabled] {
            color: @color-gray;
            opacity: 0.6;
            cursor: not-allowed;
            &:hover, &:focus {
                background-color: transparent;
            }
        }
    }
    .layout-del-row-btn {
        margin-right: 2px;
        color: @color-red;
    }
    .layout-row-cells {
        display: flex;
        flex-direction: row;
        flex: 1;
        margin-right: 1px;

        .layout-cell {
            flex: 1;
            border: 1px solid #ddd;
            text-align: center;
            cursor: pointer;
            font-weight: bold;
            color: @color-blue;
            margin: 0px 1px;
            font-size: 12px;
            padding: 0.5rem;
            border-radius: 2px;
            display: flex;
            flex-direction: row;
            justify-content: center;
            align-items: center;
            &.current, &:hover, &:focus {
                background: @color-blue;
                color: #fff;
                border-color: @color-blue;
            }
        }
    }
}

.del-cell-btn {
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    color: @color-red;
    background: transparent;
    font-size: 13px;
    &:hover, &:focus {
        background: #eee;
    }
}

form {
    label {
        display: block;
        margin-bottom: 2px;
    }
    input, select {
        width: 100%;
        height: 34px;
        padding: 0px 1rem;
        border-radius: 4px;
        border: 1px solid #ddd;
        margin-bottom: 10px;
        &[multiple]{
            height: auto;
        }

        // prevent zoom on mobile devices
        @media (max-width: 960px) and (-webkit-min-device-pixel-ratio:0) {
            font-size: 16px;
        }
    }
    textarea {
        width: 100%;
    }
    table {
        width: 100%;
    }
    .submit-form-btn {
        padding: 5px 10px;
        font-size: 13px;
        border-radius: 4px;
        color: #fff;
        background: @color-green;
        margin-bottom: 10px;
        &:hover, &:focus {
            background: lighten(@color-green, 5%);
        }
    }
}

#xt-editor-form {
    .helptext {
        font-size: 0.85em;
    }
    table th {
        width: 30%;
        max-width: 50%;
    }
    table td {
        min-width: 50%;
    }
}

@import "variables.less";
@import "custom-modals.less";

.browse-widget {
    .btn + .btn {
        margin-left: 5px;
    }
    margin-bottom: 5px;
}

#window-toolbar {
    text-align: right;
    margin-bottom: 10px;
}
